package com.cd826dong.clouddemo.event;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class MyBusEventListener implements ApplicationListener<MyBusEvent> {
    protected Logger logger = LoggerFactory.getLogger(this.getClass());
    // 通过onApplicationEvent实现对事件的处理
    @Override
    public void onApplicationEvent(MyBusEvent event) {
        this.logger.debug("Recived an remote event... ");
        this.logger.debug("Event type = {}", event.getEventType());
    }
}
